﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using app_common;

namespace tpos
{
    public partial class frm_main_menu : Form
    {
        public frm_main_menu()
        {
            InitializeComponent();
        }

        private void frm_main_menu_Resize(object sender, EventArgs e)
        {
            pnl_main_menu.Left = this.Width / 2 - pnl_main_menu.Width / 2;
            pnl_main_menu.Top = this.Height / 2 - pnl_main_menu.Height / 2;
        }

        private void btn_close_Click(object sender, EventArgs e)
        {
            app_common.APP_FORM.frm_login.Show();
        }

        private void frm_main_menu_KeyDown(object sender, KeyEventArgs e)
        {
            APP_FUNCTION.Stop_CountDown();
        }

        private void frm_main_menu_KeyUp(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
                case Keys.F2: btn_front_end_Click(sender, e); break;
                case Keys.F3: btn_close_Click(sender, e); break;
                case Keys.F12: btn_close_Click(sender, e); break;

            }
            APP_FUNCTION.Timout_CountDown();            
        }

        private void frm_main_menu_Load(object sender, EventArgs e)
        {
            APP_FORM.frm_current = this;
            APP_FUNCTION.Timout_CountDown();
        }

        private void frm_main_menu_MouseMove(object sender, MouseEventArgs e)
        {
            APP_FUNCTION.Stop_CountDown();
            APP_FUNCTION.Timout_CountDown();
        }

        private void btn_front_end_Click(object sender, EventArgs e)
        {
            Hide();
            APP_FORM.frm_parent = this;
            tpos_front_end.frm_front_end_table frm = new tpos_front_end.frm_front_end_table();
            APP_FORM.frm_current = frm;
            frm.Show();
        }
    }
}
